<template>
	<view class="common-list">
		<view class="common-list-item u-f  animated fadeInLeft">
			<!-- 左侧 -->
			<view class="common-list-left">
				<image :src="item.userpic" mode="widthFix"></image>
			</view>
			<!-- 右边 -->
			<view class="common-list-right">
				<view class="userInfo u-f u-f-js">
					<view class="userInfo-left">
						<view class=" u-f u-f-ac">
							<view class="username">{{item.username}}</view>
							<!-- <view class="tag-sex icon iconfont " :class="[item.sex == 0 ? 'icon-nan':'icon-nv']">{{item.age}}</view> -->
							<tabSex :age='item.age' :sex="item.sex"></tabSex>
						</view>
						<view class="time">26天前</view>
					</view> 
					<view class="userInfo-right" >
						<view class="common-anniu icon iconfont icon-zengjia guanzhu" @tap.stop='guanzhu' v-if='!isguanzhu'>关注</view>
						<view style="display: none;" class="icon iconfont icon-guanbi del common-anniu" @tap.stop='del(index)'></view>
					</view>
				</view> 
				<view class="contenTitle">{{item.title}}</view>
				<view class="playInfo" >
					<view class="videoBackgroundImg">
						<block v-for="(pic,index) in item.morpic" :key="index">
							<image :src="pic" mode="widthFix" lazy-load @tap.stop="imgDetail(index)"></image>
						</block>
						<!-- <view class="playIcon icon iconfont icon-bofang "></view>
						<view class="playCount">{{item.video.looknum}} 次播放 {{item.video.long}}</view> -->
					</view>
				</view>
				<view class="common-list-share u-f" v-if='item.share'>
					<image :src="item.share.titlepic" v-if='item.share.titlepic' lazy-load mode="widthFix"></image>
					<view class="title">
						{{item.share.title}}
					</view>
				</view>
				<view class="subInfo u-f u-f-js">
					<view class="subInfo-left">
						<view >{{item.path}}</view>
					</view>
					<view class="subInfo-right u-f">
						<view class="share icon iconfont icon-zhuanfa"><view>{{item.sharenum}}</view></view>
						<view class="commit icon iconfont icon-pinglun1"><view>{{item.commentnum}}</view></view>
						<view class="zan icon iconfont icon-dianzan1"><view>{{item.goodnum}}</view></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import tabSex from '../common/tab-sex.vue'
	export default {
		props:{
			item:{
				type:Object
			},
			index:Number
		},
		data() {
			return {
				isguanzhu : false
			}
		},
		components:{
			tabSex
		},
		methods: {
			imgDetail(index){
				uni.previewImage({
					current:index,
					urls:this.item.morpic
				})
			},
			guanzhu(){
				this.isguanzhu = !this.isguanzhu;
				uni.showToast({
					title:"关注成功"
				})
			},
			del(index){
				this.$emit('del',index)
			}
		}
	}
</script>

<style scoped>
	@import '../../common/common-info.css';
		
	.common-list-right{
		border:none;
	}
	.common-list-item {
		border-bottom: 1upx solid #eee;
	}
	.common-anniu {
		display: inline-block;
	}
		
	.userInfo-left{
		
	}
	.userInfo-left .time {
		color:#ccc;
		font-size: 28upx;
	}
	.username {
		font-size: 35upx; 
	}
	.videoBackgroundImg image{
		margin-bottom: 20upx ;
	}
	
</style>
